// Copyright (C) Microsoft Corporation. All rights reserved.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace Microsoft.DDSolutions.TfsAdmin
{
    public partial class Splash : Form
    {
        private string m_CaptionText = MainResources.ConnectingSplash;

        public Splash()
        {
            InitializeComponent();
        }

        public string CaptionText
        {
            get
            {
                return m_CaptionText;
            }
            set
            {
                m_CaptionText = value;
                this.Invalidate();
            }
        }

        protected override void OnPaint(PaintEventArgs e)
        {

            e.Graphics.CompositingQuality = CompositingQuality.HighQuality;


            base.OnPaint(e);

            Rectangle hline;
            LinearGradientBrush hlinebr;

            hline = new Rectangle(0, 0, this.Width, this.Height);
            hlinebr = new LinearGradientBrush(hline, Color.FromArgb(131, 166, 244), Color.FromArgb(0, 60, 165), LinearGradientMode.ForwardDiagonal);

            string msg = m_CaptionText;
            e.Graphics.FillRectangle(hlinebr, hline);
            e.Graphics.DrawString(msg, new Font("Veranda", 10), new SolidBrush(Color.Black), new PointF(10, (this.Height / 2) - 10));
            
        }

        private void Splash_Load(object sender, EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
        }
    }
}